<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<title>产品——${ request.product.PName }详细信息</title>
		<style type="text/css">
<!--
.c1 {
	font-size: 13px;
	color: #FFFFFF;
}

.c2 {
	font-size: 13px;
	font-weight: bold;
	color: #FFFFFF;
}

.title {
	font-size: 15px;
	color: #1B3E6D;
	line-height: 18pt;
	font-weight: bold;
}
-->
</style>
		<link href="css/c1.css" rel="stylesheet" type="text/css">
		<link href="css/style.css" rel="stylesheet" type="text/css">
		<link href="css/front.css" rel="stylesheet" type="text/css">
		<link href="css/guestbook.css" rel="stylesheet" type="text/css">
	</head>
<script type="text/javascript">
function gbcount(message,total,used,remain) {
 	var max;
	max = total.value;
	if (message.value.length > max) {
		message.value = message.value.substring(0,max);
		used.value = max;
		remain.value = 0;
		alert("留言不能超过 300 个字!");
	} else {
		used.value = message.value.length;
		remain.value = max - used.value;
	}
}
</script>
	<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
		<jsp:include page="top.jsp" />

		<table width="1005" border="0" align="center" cellpadding="0"
			cellspacing="0">
			<tr align="center">
				<td height="484">
					<table width="98%" height="484" border="0" cellpadding="0"
						cellspacing="0">
						<tr>
							<td width="192" height="484" valign="top">
								<table width="192" border="0" cellpadding="0" cellspacing="0">
									<tr>
										<td width="192" valign="top">
											<jsp:include page="left.jsp" />
										</td>
									</tr>
								</table>
							</td>
							<td align="center" valign="top">
								<table width="98%" border="0" cellpadding="0" cellspacing="0">
									<tr background="image/page/mean_bg.jpg">
										<td height="40" background="image/page/mean_bg.jpg">
											&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
											<img src="image/page/arr.jpg" width="14" height="6">
											<span class="title">&nbsp;产品详细</span>
										</td>
									</tr>
									<tr>
										<td valign="top">
											<table width="666" border="0" cellpadding="0" cellspacing="0">
												<tr>
													<td width="1" height="31" rowspan="3">
														&nbsp;
													</td>
													<td width="22" rowspan="3">
														&nbsp;
													</td>
													<td>

														<table width="607" height="202" border="0" cellpadding="0"
															cellspacing="0">
															<tr>
																<td width="52" height="202">
																	&nbsp;
																</td>
																<td width="130">
																	<table width="142" height="156" border="0"
																		cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
																		<tr>
																			<td width="140" height="99" bgcolor="#FFFFFF">
																				<a href="image/product/${ request.product.image }" target="_blank"><img src="image/product/${ request.product.image }" width="320" height="260" border="0"></a>
																			</td>
																		</tr>
																	</table>
																</td>
																<td width="425">
																	<form action="addProduct.action" method="post">
																		<table width="362" height="177" border="0"
																			cellpadding="0" cellspacing="0">
																			<tr>
																				<td width="37" height="40">
																					&nbsp;
																				</td>
																				<td width="18">
																					<img src="image/page/nei83.jpg" width="8"
																						height="8">
																				</td>
																				<td width="64" class="c4">
																					产品名称:
																				</td>
																				<td width="243">
																					${ request.product.PName }
																				</td>
																			</tr>
																			<tr>
																				<td height="40">
																					&nbsp;
																				</td>
																				<td>
																					<img src="image/page/nei83.jpg" width="8"
																						height="8">
																				</td>
																				<td class="c4">
																					产品条码:
																				</td>
																				<td>
																					${ request.product.barcode }
																				</td>
																			</tr>
																			<tr>
																				<td height="35">
																					&nbsp;
																				</td>
																				<td>
																					<img src="image/page/nei83.jpg" width="8"
																						height="8">
																				</td>
																				<td class="c4">
																					产品厂商:
																				</td>
																				<td>
																					${ request.product.factory }
																				</td>
																			</tr>
																			<tr>
																				<td height="35">
																					&nbsp;
																				</td>
																				<td>
																					<img src="image/page/nei83.jpg" width="8"
																						height="8">
																				</td>
																				<td class="c4">
																					产品型号:
																				</td>
																				<td>
																					${ request.product.model }
																				</td>
																			</tr>
																			<tr>
																				<td height="35">
																					&nbsp;
																				</td>
																				<td>
																					<img src="image/page/nei83.jpg" width="8"
																						height="8">
																				</td>
																				<td class="c4">
																					产品零售价格:
																				</td>
																				<td>
																					￥
																					<c:forEach items="${ request.product.prices }" var="price">
																						<c:if test="${ price.ULevel == 1 }">${ price.price}</c:if>
																					</c:forEach>元
																				</td>
																			</tr>
																			<c:if test="${ !empty session.user }">
																			<tr>
																				<td height="35">
																					&nbsp;
																				</td>
																				<td>
																					<img src="image/page/nei83.jpg" width="8"
																						height="8">
																				</td>
																				<td class="c4">
																					会员优惠价格:
																				</td>
																				<td>
																					<font color="red">￥
																					<c:forEach items="${ request.product.prices }" var="price">
																						<c:if test="${ price.ULevel == session.user.userLevel }">${ price.price}</c:if>
																					</c:forEach>元</font>
																				</td>
																			</tr>
																			</c:if>
																			<tr>
																				<td>
																					&nbsp;
																				</td>
																				<td>
																					<img src="image/page/nei83.jpg" width="8"
																						height="8">
																				</td>
																				<td class="c4">
																					订购数量:
																				</td>
																				<td>
																					<input type="hidden" name="pid"
																						value="${ request.product.PId }" />
																					<input type="text" name="pnum" value="1" size="3">
																					<br />
																				</td>
																			</tr>
																			<tr>
																				<td>
																					&nbsp;
																				</td>
																				<td>
																					&nbsp;
																				</td>
																				<td class="c4">
																				</td>
																				<td>
																					<input type="image" src="image/page/nei86.jpg"
																						width="153" height="38" border="0">
																				</td>
																			</tr>

																		</table>
																	</form>
																</td>
															</tr>
														</table>
													</td>
												</tr>
												<tr>
													<td background="image/page/nei98.jpg">
														<img src="image/page/nei81.jpg" width="620" height="11">
													</td>
												</tr>
												<tr>
													<td>
														<table width="98%" height="188" border="0" cellpadding="0"
															cellspacing="0">
															<tr>
																<td width="23">
																	&nbsp;
																</td>
																<td width="26">
																	<div align="center">
																		<img src="image/page/nei84.jpg" width="14" height="14">
																	</div>
																</td>
																<td width="575" class="c4">
																	详细描述
																</td>
															</tr>
															<tr>
																<td height="50">
																	&nbsp;
																</td>
																<td>
																	&nbsp;
																</td>
																<td valign="top">
																	${ request.product.description }
																</td>
															</tr>
															<tr>
																<td width="23">
																	&nbsp;
																</td>
																<td width="26">
																	<div align="center">
																		<img src="image/page/nei84.jpg" width="14" height="14">
																	</div>
																</td>
																<td width="575" class="c4">
																	商品评论
																</td>
															</tr>
															<tr>
																<td width="23">
																	&nbsp;
																</td>
																<td width="26">
																	&nbsp;
																</td>
																<td width="575" height="50">
																<DIV id="gbook_content">
																	<!--留言列表Begin-->
																	<c:forEach items="${ request.comments }" var="comment">
																		<DIV class="gbook_msg_list">
																			<DIV class="msg_bar">
																				<DIV class="gbook_usrname">
																					&nbsp;
																					<c:choose>
																						<c:when test="${empty comment.users.username }">匿名</c:when>
																						<c:otherwise>${ comment.users.username }</c:otherwise>
																					</c:choose>
																				</DIV>
																				<DIV class="msg_time">
																					<fmt:formatDate value="${ comment.PCTime }"
																						pattern="yyyy-MM-dd HH:mm:ss" />
																				</DIV>
																			</DIV>
																			<DIV class="msg_content">
																				&nbsp;&nbsp;&nbsp;&nbsp;${ comment.PCContent }
																			</DIV>
																			<c:if test="${ !empty comment.replays }">
																				<c:forEach items="${ comment.replays }" var="replay">
																					<DIV class="reply_content">
																						<div class="msg_bar">
																						<DIV class="gbook_answer">
																							管理员${ replay.admin.adminName }
																							&nbsp;为您服务:
																						</DIV>
																						<DIV class="msg_time">
																							<fmt:formatDate value="${ replay.PCTime }"
																								pattern="yyyy-MM-dd HH:mm:ss" />
																						</DIV>
																						<br/>
																						
																					</DIV>
																						&nbsp;&nbsp;&nbsp;&nbsp;${ replay.PCContent }
																						</DIV>
																				</c:forEach>
																			</c:if>
																		</DIV>
																	</c:forEach>
																</DIV>
																</td>
															</tr>
															<c:if test="${ !empty request.comments }">
																<tr>
																	<td width="23">
																		&nbsp;
																	</td>
																	<td width="26">
																		&nbsp;
																	</td>
																	<td width="575">
																		<table width="100%" border="0" cellspacing="0"
																			cellpadding="5">
																			<tr valign="middle">
																				<td>
																					<div align="center" class="pagebar">
																						${ request.pageuri }
																					</div>
																				</td>
																			</tr>
																		</table>
																	</td>
																</tr>
															</c:if>
															<tr><td><div style="color: #f00">
															${ request.msg }
														</div></td></tr>
															
															<tr>
																<td width="23">
																	&nbsp;
																</td>
																<td width="26">
																	&nbsp;
																</td>
																<td width="575" valign="top">
																	<form name="form1" method="post"
																		action="comment.action">
																		<table width="100%" height="323" border="0"
																			align="center" cellpadding="0" cellspacing="1"
																			style="MARGIN-TOP: 10px; MARGIN-BOTTOM: 10px"
																			bgColor="#7dbfdb" class="c1">
																			<tr>
																				<td bgColor="#7dbfdb" height="25" align="left" colspan="3">
																					&nbsp;<input type="hidden" name="pid" value="${ request.product.PId }">
																					<IMG border="0" alt="" align="absMiddle"
																						src="image/page/liuyan.gif" width="14" height="12">
																					<strong>我 要 评 论</strong>
																				</td>
																			</tr>
																			<tr class="texthei">
																				<td width="153" height="135" align="right"
																					valign="top" bgcolor="#FFFFFF">
																					<font color="#333333"><br> <br> <br>
																						<br> 评论内容： </font>
																				</td>
																				<td colspan="3" bgcolor="#FFFFFF">
																					<font color="#333333"> &nbsp; <textarea
																							name="content" cols="60" rows="8"
																							class="input1" id="content"
																							onKeyDown="gbcount(this.form.content,this.form.total,this.form.used,this.form.remain);"
																							onKeyUp="gbcount(this.form.content, this.form.total, this.form.used, this.form.remain);"></textarea>
																						<br /> 最多字数： <input disabled="disabled"
																							maxLength="4" id="total" size="3" value="300"
																							class="input1"> 已用字数： <input
																							disabled="disabled" maxLength="4" id="used"
																							size="3" value="0" class="input1"> 剩余字数：
																						<input disabled="disabled" maxLength="4"
																							id="remain" size="3" value="300" class="input1">
																					</font>
																				</td>
																			</tr>
																			<tr class="texthei">
																				<td style="LINE-HEIGHT: 20px; color: #333;"
																					align="left" colspan="4" bgcolor="#FFFFFF">
																					&nbsp;&nbsp;1.用户发表评论仅代表其个人意见，并且承担一切因发表内容引起的纠纷和责任;
																					<br />
																					&nbsp;&nbsp;2.本站管理人员有权在不通知用户的情况下删除不符合规定的留言信息或留做证据;
																					<br />
																					&nbsp;&nbsp;3.请客观的评价您所看到的资讯，提倡就事论事，杜绝漫骂和人身攻击等不文明行为.
																				</td>
																			</tr>
																			<tr class="texthei">
																				<td colspan="4" align="right" valign="top"
																					bgcolor="#FFFFFF">
																					<div align="center">
																						<input class="input1" type="submit" value="立刻发送" />
																						<input class="input1" type="reset" value="重新填写" />
																						<br />
																						<img height="1" src="" width="400" />
																					</div>
																				</td>
																			</tr>
																		</table>
																	</form>
																</td>
															</tr>
															<tr>
																<td>
																	&nbsp;
																</td>
																<td>
																	<div align="center"></div>
																</td>
																<td>
																	&nbsp;
																</td>
															</tr>
														</table>
													</td>
												</tr>
												<tr>
													<td>
														&nbsp;
													</td>
													<td>
														&nbsp;
													</td>
													<td>
														&nbsp;
													</td>
												</tr>
											</table>
										</td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
		<jsp:include page="bottom.jsp" />

	</body>
</html>
